<!DOCTYPE html>
<html lang="zh_CN">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script type="text/javascript">


    function add(a, b) {
        console.log(this);
        return a + b;
    }


    console.log(add(12, 23)); // this 代表 window对象

    var obj = {n1:1, n2: 12};


    console.log(add.call(obj, obj.n1, obj.n2));

    console.log(add.apply(obj, [obj.n1, obj.n2]));

    console.log('==============');


    var fn = add.bind(obj);
    console.log(fn);

    console.log(fn(12, 23), 'fn 里面的 this');


</script>

</html>
